Telegram Group & Telegram Channel
⚡️ Фича дня: if consteval в C++23

Хотите разный код для compile-time и runtime? C++23 добавляет if consteval для условной компиляции!


🔴 До: Сложные трюки

template<typename T>
constexpr T compute() {
if (std::is_constant_evaluated()) {
return compile_time_version<T>();
}
return runtime_version<T>();
}



🟢 После: Читаемый consteval

template<typename T>
constexpr T compute() {
if consteval {
return compile_time_version<T>();
} else {
return runtime_version<T>();
}
}



❗️Практические применения:

• Оптимизированные математические библиотеки
• Compile-time криптография
• Генерация lookup-таблиц


💡Используете метапрограммирование в ваших проектах?

Библиотека C/C++ разработчика #буст
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/cppproglib/5782
Create:
Last Update:

⚡️ Фича дня: if consteval в C++23

Хотите разный код для compile-time и runtime? C++23 добавляет if consteval для условной компиляции!


🔴 До: Сложные трюки

template<typename T>
constexpr T compute() {
if (std::is_constant_evaluated()) {
return compile_time_version<T>();
}
return runtime_version<T>();
}



🟢 После: Читаемый consteval

template<typename T>
constexpr T compute() {
if consteval {
return compile_time_version<T>();
} else {
return runtime_version<T>();
}
}



❗️Практические применения:

• Оптимизированные математические библиотеки
• Compile-time криптография
• Генерация lookup-таблиц


💡Используете метапрограммирование в ваших проектах?

Библиотека C/C++ разработчика #буст

BY Библиотека C/C++ разработчика | cpp, boost, qt




Share with your friend now:
tg-me.com/cppproglib/5782

View MORE
Open in Telegram


Библиотека C C разработчика | cpp boost qt Telegram | DID YOU KNOW?

Date: |

However, analysts are positive on the stock now. “We have seen a huge downside movement in the stock due to the central electricity regulatory commission’s (CERC) order that seems to be negative from 2014-15 onwards but we cannot take a linear negative view on the stock and further downside movement on the stock is unlikely. Currently stock is underpriced. Investors can bet on it for a longer horizon," said Vivek Gupta, director research at CapitalVia Global Research.

Mr. Durov launched Telegram in late 2013 with his brother, Nikolai, just months before he was pushed out of VK, the Russian social-media platform he founded. Mr. Durov pitched his new app—funded with the proceeds from the VK sale—less as a business than as a way for people to send messages while avoiding government surveillance and censorship.

Библиотека C C разработчика | cpp boost qt from id


Telegram Библиотека C/C++ разработчика | cpp, boost, qt
FROM USA